package com.lpf.json.fastjson.filter.classLevelFilter;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.NameFilter;
import com.alibaba.fastjson.serializer.SerializeConfig;

public class TestClassLevelFilter {

	public static void main(String[] args) {
		NameFilter upcaseNameFilter = new NameFilter() {
			public String process(Object object, String name, Object value) {
				return name.toUpperCase();
			}
		};
		SerializeConfig.getGlobalInstance().addFilter(A.class, upcaseNameFilter);

		System.out.println(JSON.toJSONString(new A()));
		System.out.println(JSON.toJSONString(new B()));
	}

}